package Pages;

import appium1.common.Helper;
import org.openqa.selenium.WebElement;

public class PageHome {
    private Helper helper;

    public PageHome(Helper helper) {
        this.helper = helper;
    }

    public WebElement getNewsTitleTextView(int index) {
        return helper.findByid("net.oschina.app:id/tv_title", index);
    }

    public String getNewTitle(int index) {
        return helper.getText(getNewsTitleTextView(index));
    }

    public void clickNewsTiele(int index) {
        helper.click(getNewsTitleTextView(index));
    }
}
